package com.vunguyen.model;
// Generated Dec 28, 2014 10:51:48 PM by Hibernate Tools 3.6.0


import java.util.HashSet;
import java.util.Set;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.GeneratedValue;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.OneToMany;
import javax.persistence.OneToOne;
import javax.persistence.PrimaryKeyJoinColumn;
import javax.persistence.Table;
import org.hibernate.annotations.GenericGenerator;
import org.hibernate.annotations.Parameter;

/**
 * Giangvien generated by hbm2java
 */
@Entity
@Table(name="giangvien"
    ,catalog="qlkhoacntt"
)
public class Giangvien  implements java.io.Serializable {


     private int idCanBo;
     private Canbo canbo;
     private Bomon bomon;
     private String chucVu;
     private String chucDanhKhoaHoc;
     private Set<PhancongcongvandenGiangvien> phancongcongvandenGiangviens = new HashSet<PhancongcongvandenGiangvien>(0);
     private Set<Lichlamviec> lichlamviecs = new HashSet<Lichlamviec>(0);
     private Set<Phieudangky> phieudangkies = new HashSet<Phieudangky>(0);

    public Giangvien() {
    }

	
    public Giangvien(Canbo canbo, Bomon bomon, String chucVu, String chucDanhKhoaHoc) {
        this.canbo = canbo;
        this.bomon = bomon;
        this.chucVu = chucVu;
        this.chucDanhKhoaHoc = chucDanhKhoaHoc;
    }
    public Giangvien(Canbo canbo, Bomon bomon, String chucVu, String chucDanhKhoaHoc, Set<PhancongcongvandenGiangvien> phancongcongvandenGiangviens, Set<Lichlamviec> lichlamviecs, Set<Phieudangky> phieudangkies) {
       this.canbo = canbo;
       this.bomon = bomon;
       this.chucVu = chucVu;
       this.chucDanhKhoaHoc = chucDanhKhoaHoc;
       this.phancongcongvandenGiangviens = phancongcongvandenGiangviens;
       this.lichlamviecs = lichlamviecs;
       this.phieudangkies = phieudangkies;
    }
   
     @GenericGenerator(name="generator", strategy="foreign", parameters=@Parameter(name="property", value="canbo"))@Id @GeneratedValue(generator="generator")

    
    @Column(name="idCanBo", unique=true, nullable=false)
    public int getIdCanBo() {
        return this.idCanBo;
    }
    
    public void setIdCanBo(int idCanBo) {
        this.idCanBo = idCanBo;
    }

@OneToOne(fetch=FetchType.EAGER)@PrimaryKeyJoinColumn
    public Canbo getCanbo() {
        return this.canbo;
    }
    
    public void setCanbo(Canbo canbo) {
        this.canbo = canbo;
    }

@ManyToOne(fetch=FetchType.EAGER)
    @JoinColumn(name="idBoMon", nullable=false)
    public Bomon getBomon() {
        return this.bomon;
    }
    
    public void setBomon(Bomon bomon) {
        this.bomon = bomon;
    }

    
    @Column(name="ChucVu", nullable=false, length=50)
    public String getChucVu() {
        return this.chucVu;
    }
    
    public void setChucVu(String chucVu) {
        this.chucVu = chucVu;
    }

    
    @Column(name="ChucDanhKhoaHoc", nullable=false, length=50)
    public String getChucDanhKhoaHoc() {
        return this.chucDanhKhoaHoc;
    }
    
    public void setChucDanhKhoaHoc(String chucDanhKhoaHoc) {
        this.chucDanhKhoaHoc = chucDanhKhoaHoc;
    }

@OneToMany(fetch=FetchType.EAGER, mappedBy="giangvien")
    public Set<PhancongcongvandenGiangvien> getPhancongcongvandenGiangviens() {
        return this.phancongcongvandenGiangviens;
    }
    
    public void setPhancongcongvandenGiangviens(Set<PhancongcongvandenGiangvien> phancongcongvandenGiangviens) {
        this.phancongcongvandenGiangviens = phancongcongvandenGiangviens;
    }

@OneToMany(fetch=FetchType.EAGER, mappedBy="giangvien")
    public Set<Lichlamviec> getLichlamviecs() {
        return this.lichlamviecs;
    }
    
    public void setLichlamviecs(Set<Lichlamviec> lichlamviecs) {
        this.lichlamviecs = lichlamviecs;
    }

@OneToMany(fetch=FetchType.EAGER, mappedBy="giangvien")
    public Set<Phieudangky> getPhieudangkies() {
        return this.phieudangkies;
    }
    
    public void setPhieudangkies(Set<Phieudangky> phieudangkies) {
        this.phieudangkies = phieudangkies;
    }




}


